#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() 
{
	int i;
	scanf("%d",&i);
	int count = 0;
	while (i--)
	{
		int a, b, c;
		
		scanf("%d %d %d", &a, &b, &c);
		if (a + b + c < 3 * 60)
			++count;
	}
	printf("%d", count);
}
